package com.wwwarehouse.resource_center.fragment.information;

import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.widget.TextView;

import com.wwwarehouse.common.bean.response.CommonClass;
import com.wwwarehouse.resource_center.R;
import com.wwwarehouse.resource_center.fragment.rules.TheParentFragment;

/**
 * @author Joseph on 2017/9/27.
 *         <p/>
 *         分类名称
 */

public class InfomationCategoryNameFragment extends TheParentFragment {

    private TextView mCategoryName;
    private String categoryName;
    private String title;

    @Override
    protected int getContentId() {
        return R.layout.fragment_infomation_category_name;
    }

    @Override
    public void setTitle() {
        if (peekFragment() instanceof InfomationCategoryNameFragment)
            if (!TextUtils.isEmpty(title)) {
                mActivity.setTitle(title);
            }
    }

    @Override
    protected void init(View view) {
        mCategoryName = findView(view, R.id.tv_name);
    }

    @Override
    protected void loadDatas() {
        try {
            Bundle arguments = getArguments();
            categoryName = arguments.getString("CategoryName");
            title = arguments.getString("title");
            mActivity.setTitle(title);
        } catch (Exception e) {
            e.printStackTrace();
        }
        mCategoryName.setText(categoryName);
    }

    @Override
    public void onSuccess(CommonClass commonClass, int what) {

    }


    @Override
    public void onReLoad(int code) {

    }
}
